package MyTest;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.tornado.system.model.Orders;
import com.tornado.system.model.Shopping;
import com.tornado.system.service.IorderService;
import com.tornado.system.service.IshoppingService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class Mytest {
	
	@Autowired
	private IorderService orderService;
	
	@Autowired
	private IshoppingService shoppingService;
	
    @Test
   public void syso() {
 
	System.out.println("sdfsafd");
	System.out.println("111");
	System.out.println("222");
	
}
    
    //测试订单列表
    @Test
    public void ordertest(){
    	List<Orders> list=orderService.orderList();
    	System.out.println(list);
    }
    //测试通过订单号查询
    @Test
    public void ordertest2(){
    	List<Orders> list=orderService.orderListByOrderId("6");
    	System.out.println(list);
    }
  //测试通过用户id号查询
    @Test
    public void ordertest3(){
    	List<Orders> list=orderService.orderListByUserId(2);
    	System.out.println(list);
    }
    
  //测试通过订单号和用户id号查询
    @Test
    public void ordertest4(){
    	List<Orders> list=orderService.orderListByOrderIdUserId("6", 2);
    	System.out.println(list);
    }
    //
    @Test
    public void aa(){
    	List<Shopping> shopps = shoppingService.getShoppinglist();
    	System.out.println(shopps);
    }
    
}
